﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Big2.CardsLib
{

    //Enumeration for the Suits
    //weakest suit is lowest #
    public enum CardSuit
    {
        Diamonds = 1,
        Clubs = 2,
        Hearts = 3,
        Spades = 4
    }//Enum CardSuit

    public enum CardRank
    {
        Ace = 1,
        Two = 2,
        Three = 3,
        Four = 4,
        Five = 5,
        Six = 6,
        Seven = 7,
        Eight = 8,
        Nine = 9,
        Ten = 10,
        Jack = 11,
        Queen = 12,
        King = 13
    }//enum CardRank

    [Serializable]
    public class Card 
    {
        private CardSuit _Suit;                         
        private CardRank _Rank;
        private int _Value;
        
        //no parameter constructor
        public Card()
        {
            //empty definition
        }//no parameter constructor

        //2 parameter constructor
        //passing suit and rank as ints
        public Card(CardRank r, CardSuit s)
        {
            _Suit = s;
            _Rank = r;
            _Value = (int)_Rank;
        }//2 parameter constructor



        //returns/sets current suit
        public CardSuit Suit
        {
            get { return _Suit; }
            set { _Suit = value; }
        }//getSuit()

        //return current rank
        public CardRank Rank
        {
            get { return _Rank; }
            set { _Rank = value; }
        }//getRank()

        //return current value
        public int Value
        {
            get{ return _Value; }
            set { _Value = value; }
        }//getValue()

        //check to see if card is same suit
        public bool isSameSuit(Card c)
        {
            return (_Suit == c.Suit);
        }//isSameSuit(Card c)

        //check to see if card is same rank
        public bool isSameRank(Card c)
        {
            return (_Rank == c.Rank);
        }//isSameRank(Card c)

        //check to see if card is same value
        public bool isSameValue(Card c)
        {
            return (_Value == c.Value);
        }//isSameValue(Card c)

        //check to see if card is same card
        public bool isSameCard(Card c)
        {
            return Rank == c.Rank && _Suit == c.Suit && _Value == c.Value;
        }//isSameCard(Card c)

        //Override tostring to display its contents
        public override string ToString()
        {
            return _Rank + " of " + _Suit;
        }//tostring()

        //return the file name of the card image 
        public string CardFileName()
        {
            return this._Rank + " of " + this._Suit + ".png";
        }//CardFileName()

    }//class Card
}//closing brace
